package com.yykj.common.dto;

import com.tencent.cloud.Response;
import lombok.Data;

@Data
public class StsDTO {
    public String tmpSecretId;
    public String tmpSecretKey;
    public String sessionToken;

    private long startTime;
    private long expiredTime;
    private String uploadPath;
    private String bucketName;
    private String region;

    public static StsDTO convert(Response response){
        StsDTO dto = new StsDTO();
        dto.tmpSecretId = response.credentials.tmpSecretId;
        dto.tmpSecretKey = response.credentials.tmpSecretKey;
        dto.sessionToken = response.credentials.sessionToken;
        dto.startTime = response.startTime;
        dto.expiredTime = response.expiredTime;

        return dto;
    }
}
